<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue样式</title>
    <script src="scripts/jquery-3.4.1.min.js"></script>
    <script src="scripts/vue.js"></script>
    <style>
        .page{
            height: 200px;
            width: 200px;
            background-color: skyblue;
            display: none;
        }
        .active{
            display:block;
        }
    </style>
</head>
<body>
    <div id="app">        
        <!--通过vue对象的方式决定是否存在某个类-->
        <div :class="{active:isTrue}" class="page" ></div>
        <!--直接放置对象-->
        <div :class="styleObj" class="page" ></div>        
        <hr>
        <!--使用数组-->
        <div :class="styleArr" class="page" ></div>        
        <hr>
        <!--使用字符串-->
        <div :class="styleStr" class="page" ></div>   
        <hr>
        <!--数组和对象混合使用-->
        <div :class="styleArrObj" class="page" ></div>   
    </div>

    <script>
        let app=new Vue({
            el:"#app",
            data:{
                isTrue:true,
                styleObj:{active:true,xlb:true,"layui-col-lg-offset1":true},
                //可直接用数组的方式添加和删除
                styleArr:["active","layui-col-lg-offset1"],
                //直接使用字符串
                styleStr:"wed wer dsff ddsfd",
                //数组和对象混合使用
                styleArrObj:["sfd",{active:true}]
            }
        })
    </script>
</body>
</html>